home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
SMAK124.ARJ
/
SMAK.DOC
< prev
next >
Wrap
Text File
|
1992-04-12
|
13KB
|
292 lines
SMAK
Did you ever try to use one of the big-name MAKE programs, only to find
yourself facing a steep slope at the front of the learning curve? I
know the feeling, so I decided to "make" it easier.
Kiss your compile and link headaches goodbye with SMAK, the Simple MAKE
utility from Martin Systems.
So much for the commercial. Here's the beef.
Simple MAKE automates the compile/link process, but keeps it simple. It
reads a short, well-defined script which is stored in your source code
and builds the executable file without further intervention.
SMAK is shareware and may be distributed freely as long as the additional
document files are distributed with it. Registration is only $25 and
provides registered owners with the following benefits:
1. An enhanced version of SMAK, plus free upgrade privileges for
one year. Current enhancements include:
Greater capacity (up to 128 list files).
Option to check all include files for changes when
determining a conditional compile.
Compile and link errors stop the make process.
(Other enhancements will surely follow.)
2. QuickBasic source code for SMAK.
3. A $15 discount on Basic Building Blocks (normally $35), our
library of assembly language routines and QuickBasic subprograms.
Some BBB routines were crucial in creating SMAK. They are written
to be smaller and faster than other high-priced libraries (which I
cut my teeth on), while providing the same or greater functionality.
See the file BBB.DOC describing Basic Building Blocks.
SMAK is primarily designed to work with Microsoft QuickBasic 2.0 and
above, but it can also make PDS, assembler, and C programs. It is small
and fast, taking only 12K of disk space and reserving only 26K of RAM when
loaded and running the compiler or linker. It is also Desqview aware and
will "behave" in a DV window despite using some direct screen writes.
Syntax for running SMAK is: [path\]SMAK source[.ext] [options]
where: source is the source file name that contains
the main source code module and the make script
If no extension is given for file name, .BAS is assumed. Options are:
/F force compile and link of all source files
/2 pass compiler instructions in Microsoft C format
/M have linker generate a MAP file
/E assume all source/object files exist somewhere
/C compile only
/L link only
The script that SMAK reads may be anywhere in the source file (or in its
own separate file), though near the beginning of the file is best for
fastest processing. Storing the script in the source file saves disk
space by not creating a separate make file, and also documents all files
needed to create the final EXE file within the main source code module.
All lines of the script are commented off with apostrophes. It looks like
this:
1 'begin make 'identifies start of script
2 ' c:\qb45\bc 'name of compiler program
3 ' c:\qb45\link /nod /noe 'name of linker with link options
4 ' begin BAS 'start of source file list
5 ' d:\make\smak /o 'main source file & compile options
6 ' d:\bbb\strip /o 'other source file & compile options
7 ' d:\bbb\parse /o 'other source file & compile options
8 ' begin OBJ 'start of object file list
9 ' d:\bbb\FileInfo 'object file name
10 ' d:\bbb\CheckKB 'many object files may be
11 ' c:\pdq\_noread ' listed here, just like for
12 ' c:\pdq\_noerror ' for the BAS source files
13 ' c:\pdq\_noval '(this is a PDQ stub file)
14 ' begin LIB 'start of link library file list
15 ' c:\pdq\pdq ' many LIB files may follow
16 'end make 'identifies end of script
Line numbers are added here only as an aide to the detailed explanation
that follows. Each line would actually start with ' in the source
file. Any line can contain trailing comments that also begin with an
apostrophe, which SMAK ignores. SMAK does not change the case of any
line so that case-sensitive parameters may be used (as in C).
Line 1 simply identifies the beginning of the MAKE script.
Line 2 contains the compiler program name that you would normally need to
type to run your compiler. It's a good idea to include its drive and
path spec, so DOS won't have to spend time searching through the
directories in your PATH statement. You may leave the compiler program
name blank, if desired, to perform linking only.
Line 3 contains the linker program name that you would normally need to
type to run your linker. Again, include its drive and path for fastest
loading. You may leave the linker program name blank, if desired, to
perform compiling only. Any link options to be used during linking should
follow the linker program name, separated from it by a space.
Line 4 identifies the start of the list of source files. Often there is
only one, but you can have many source files (one per line) in the list.
Each one will be compiled, and their respective object files will be linked
into the final EXE file. The BAS specifies the default file extension for
any files in the list which do not have file extensions. You can specify
any other default file extension if desired, like PDS, ASM, C, or PDQ.
Line 5 contains the name of the main source code file. Again, include its
drive and path for fastest processing and to know where its object file
will end up residing. The main source code module should be first in the
list, since the resulting EXE file will have the same name as the first
source file. Compiler options can follow the source code file name, and
can be different for each source code file.
Lines 6 and 7 are additional source modules needed to make the example
program SMAK.EXE.
Line 8 identifies the start of the list of object files. Often there
will be none, since all object files created by compiling the source code
files are automatically passed to the linker. You can have many object
files (one per line) in the list. Each one will be linked into the
final EXE file. The OBJ specifies the default file extension for any
files in the list which do not have file extensions, and may be changed.
Library files may be included in the object file list, but be aware that
every routine in that library will be linked into the final EXE file,
whether it is called or not. Library files should usually go in the
library file list. See the explanation for line 14.
Lines 9 through 13 are additional object module file names which were
NOT created by compiling the source code files listed under "begin BAS"
but are referenced or needed for a successful link.
Line 14 identifies the start of the list of library files. Often there
will be none, since the default library file name (like BRUN45.LIB or
BCOM45.LIB if you used QB's /O compile switch) is usually passed to the
linker in the main object file. If the correct default LIB file is not
in your path, or its path is not found in the LIB environment variable,
you may need to include its complete file spec here. You can have many
library files (one per line) in the list. Library files in this list are
searched for any missing routines needed to complete the link, and only
called routines are linked into the final EXE file. The LIB specifies
the default file extension for any files in the list which do not have
file extensions, and may be changed.
Line 15 contains a link library needed in this example to make the
SMAK.EXE program.
Line 16 identifies the end of the script.
The example below shows a simple script needed to create the file
HELLO.EXE from the source code file HELLO.BAS.
'===================== Begin program HELLO.BAS ====================
'begin make 'identifies start of script
' c:\qb45\bc 'name of compiler program
' c:\qb45\link 'name of link program
' begin BAS 'start of source file list
' c:\bbb\hello /o 'main source file & compile options
'end make 'identifies end of script
print " HELLO! (compiled and linked with SMAK, written in QuickBasic 4.5)"
end
'====================== End program HELLO.BAS =====================
SMAK works with other languages besides QuickBasic, like assembler and C.
See the files SMAK_C.DOC and SMAK_ASM.DOC for more information.
Notes about path specs:
SMAK does its work quicker and more accurately if you use complete path
specs for all files in the make directives. SMAK verifies that each
source or object file exists. If any files are missing, SMAK will
identify them and terminate before compiling or linking. Each file's
date/time stamp is also noted for conditional compiling and linking.
SMAK checks for files without path specs in the current directory only.
SMAK will not search your PATH or LIB directories for a file. If you
rely on your compiler or linker to find certain files in those
directories, and you do not specify their paths in the make directives,
you will need to use the /E command line switch when you invoke SMAK.
Another advantage of using path specs with your file names is that you
can run SMAK while in any directory, against a source file in any
directory, and still have all the files produced by compiling and linking
end up where they are supposed to be. I use a simple batch file in my
path containing F:\MAKE\SMAK %1 %2 %3 %4 to make my programs.
Notes on command line parameters:
The /E parameter tells SMAK to assume that any source or object file it
cannot find exists anyway. The compiler and linker are then responsible
for checking that the file exists. Conditional compilation of that file
also becomes the responsibility of the compiler, as well.
The /2 parameter passes the compile commands to the compiler (or assembler)
in the following format: CompilerName SourceName [options]
The default format is: CompilerName SourceName, ObjectName [options];
The /C parameter tells SMAK to compile only. No linking occurs. Note
that which modules are compiled is still conditional. Use /C/F to do an
unconditional compile only.
The /L parameter tells SMAK to link only. No compiling occurs. Note
that linking is still conditional. Use /L/F to do an unconditional link
only.
Miscellaneous notes:
Maximum number of file names in the combined source, object, and library
lists is 32. The actual number in each list may vary, as long as the
sum does not exceed 32. If you need greater capacity, combine object
files into one or more libraries, or register to receive the enhanced
version which allows up to 128 files in the combined lists.
If you have a list of library files, you must also always have a list of
object files, even if it is an empty list. The SMAK program always
considers the second "begin" to mark the start of the object file list.
D I S C L A I M E R
By using this software, you agree to hold harmless Martin Systems for any
resulting loss or damage. There are no warranties expressed or implied.
==============================================================================
REGISTRATION FORM
NAME ______________________________________________
ADDRESS ______________________________________________
CITY _____________________________ STATE ______ ZIP _________
PHONE (_______)____________________
QTY NET
SMAK registration only ______ @ $25 each = ______
Basic Building Blocks only ______ @ $35 each = ______
Basic Building Blocks and SMAK (!) ______ @ $45 each = ______
(Prices include US Mail shipping) TOTAL ______
Diskette type: [ ] 360K [ ] 720K
Send to: Martin Systems
120 Fence Post Court
Fountain, CO 80817
(719) 382-8216 BBS
==============================================================================